home *** CD-ROM | disk | FTP | other *** search
/ Light ROM Gold / Light ROM Gold.iso / arexx / load3_5.lwm < prev    next >
Text File  |  1995-09-04  |  3KB  |  129 lines

  1. /* CMD: Load Project
  2.  *
  3.  * This is a Lightwave Modeler Macro that will load a project that
  4.  * was saved with the "Save_Project.lwm" macro.  It will load all objects
  5.  * up into seperate layers again.
  6.  *
  7.  * 2/94  Jason Mussetter
  8.  *
  9.  * 4/95 Modified By Daniel Bernard
  10.  * 
  11.  *      Added Code to Bring Up file requester 
  12.  *      for project selection instead of having
  13.  *      to remember the project name
  14.  *
  15.  */
  16.  
  17.  
  18.  
  19.    mxx="LWModelerARexx.port"
  20.    signal on error
  21.    signal on syntax
  22.    mxx_add = addlib(mxx,0)
  23.    call main
  24.    if (mxx_add) then call remlib(mxx)
  25.    exit
  26.  
  27.    syntax:
  28.    error:
  29.    t=Notify(1,'Rexx Script Error','@'ErrorText(rc), 'Line 'SIGL)
  30.    if (mxx_add) then call remlib(mxx)
  31.    exit
  32.  
  33. main:   
  34.  
  35. /* 
  36.     This section Modified By Daniel Bernard 4/95
  37.  
  38.     Use a standard requestor to  ask the user
  39.     for the Prefix of the Project's name.  
  40. */
  41.  
  42.      Prj_Prfx = GetFileName('Select Project File:')
  43.      if Prj_Prfx = "(none)" then exit
  44.      if Length(Prj_Prfx) < 1 then exit
  45.      p = pos(".",Prj_Prfx)
  46.      Prj_Prfx = Left(Prj_Prfx, (p - 2))
  47.      ProjectPrifix = Prj_Prfx 
  48.  
  49. numlay:
  50.  
  51.    CALL REQ_BEGIN("Load Project")
  52.  
  53.      Num_Layr = REQ_ADDCONTROL("Number of Layers",number,0)
  54.      CALL REQ_POST()
  55.      If result = 0 then return
  56.  
  57.      LayerCount = REQ_GETVAL(Num_Layr)
  58.      
  59.         
  60.    CALL REQ_END()
  61.  
  62.      if LayerCount > "10" then call  numlay
  63.      if LayerCount = "0" then call  numlay
  64.      
  65.    Cont = NOTIFY(3,"All project files are there?")
  66.    If result = 0 then return 
  67.    if result = 1 then exit
  68.     
  69.  
  70.  
  71. /* After we have the Project's name prefix, we'll load each layer. 
  72.  *
  73.  * NOTE: I added code to check for the existence of the object files
  74.  *       this should make macro more stable and more forgiving 
  75.  */
  76.  
  77.  
  78.    CALL SETLAYER(1)
  79.    if EXISTS(ProjectPrifix||"1.lwob") then do
  80.      if LayerCount > 0 then CALL LOAD(ProjectPrifix||"1.lwob")
  81.    end
  82.             
  83.    CALL SETLAYER(2)
  84.    if EXISTS(ProjectPrifix||"2.lwob") then do
  85.      if LayerCount > 1 then CALL LOAD(ProjectPrifix||"2.lwob")
  86.    end
  87.       
  88.    CALL SETLAYER(3)
  89.    if EXISTS(ProjectPrifix||"3.lwob") then do
  90.       if LayerCount > 2 then CALL LOAD(ProjectPrifix||"3.lwob")
  91.    end
  92.       
  93.    CALL SETLAYER(4)
  94.    if EXISTS(ProjectPrifix||"4.lwob") then do
  95.       if LayerCount > 3 then CALL LOAD(ProjectPrifix||"4.lwob")
  96.    end
  97.    
  98.    CALL SETLAYER(5)
  99.    if EXISTS(ProjectPrifix||"5.lwob") then do
  100.       if LayerCount > 4 then CALL LOAD(ProjectPrifix||"5.lwob")
  101.    end
  102.    
  103.    CALL SETLAYER(6)
  104.    if EXISTS(ProjectPrifix||"6.lwob") then do
  105.         if LayerCount > 5 then CALL LOAD(ProjectPrifix||"6.lwob")
  106.    end
  107.    
  108.    CALL SETLAYER(7)
  109.    if EXISTS(ProjectPrifix||"7.lwob") then do
  110.         if LayerCount > 6 then CALL LOAD(ProjectPrifix||"7.lwob")
  111.    end   
  112.    
  113.    CALL SETLAYER(8)
  114.    if EXISTS(ProjectPrifix||"8.lwob") then do
  115.         if LayerCount > 7 then CALL LOAD(ProjectPrifix||"8.lwob")
  116.    end   
  117.    
  118.    CALL SETLAYER(9)
  119.    if EXISTS(ProjectPrifix||"9.lwob") then do     
  120.         if LayerCount > 8 then CALL LOAD(ProjectPrifix||"9.lwob")
  121.    end
  122.       
  123.    CALL SETLAYER(10)
  124.    if EXISTS(ProjectPrifix||"10.lwob") then do
  125.         if LayerCount > 9 then CALL LOAD(ProjectPrifix||"10.lwob")
  126.    end
  127.    
  128. return
  129.